/*
 * @Author: dengzhijun 1726768643@qq.com
 * @Date: 2025-01-17 09:30:23
 * @LastEditors: dengzhijun 1726768643@qq.com
 * @LastEditTime: 2025-01-24 10:15:09
 * @FilePath: /Tools/Tool/include/ILogger.h
 * @Description: 
 * Copyright (c) 2025 by ${dengzhijun} email: ${1726768643@qq.com}, All Rights Reserved.
 */
#ifndef TOOLS_ILOGGER_H
#define TOOLS_ILOGGER_H

#include "Global.h"
#include <string>
namespace Tool
{
enum class LogLevel
{
    Debug = 0,   // 调试
    Info,    // 信息
    Warning, // 警告
    Error    // 错误
};

class ExportAPI ILogger
{
public:
    static ILogger *GetInstance();
    static ILogger *GetLogsInstance();
    // virtual void Write(const char *fileName, int lineNumber, LogLevel level, const char *format, ...) = 0;
    virtual void Write(const char *fileName, int lineNumber, LogLevel level, std::string logerName, const char *format, ...) = 0;
    virtual void SetOutputToConsole(bool output) = 0;
    virtual void SetLevel(LogLevel level) = 0;
};

#define LOG_DEBUG(message, ...) Tool::ILogger::GetInstance()->Write(__FILE__, __LINE__, Tool::LogLevel::Debug, "", message, ##__VA_ARGS__)
#define LOG_INFO(message, ...) Tool::ILogger::GetInstance()->Write(__FILE__, __LINE__, Tool::LogLevel::Info, "", message, ##__VA_ARGS__)
#define LOG_WARN(message, ...) Tool::ILogger::GetInstance()->Write(__FILE__, __LINE__, Tool::LogLevel::Warning, "", message, ##__VA_ARGS__)
#define LOG_ERROR(message, ...) Tool::ILogger::GetInstance()->Write(__FILE__, __LINE__, Tool::LogLevel::Error, "", message, ##__VA_ARGS__)

#define LOGS_DEBUG(logerName, message, ...) Tool::ILogger::GetLogsInstance()->Write(__FILE__, __LINE__, Tool::LogLevel::Debug, logerName, message, ##__VA_ARGS__)
#define LOGS_INFO(logerName, message, ...) Tool::ILogger::GetLogsInstance()->Write(__FILE__, __LINE__, Tool::LogLevel::Info, logerName, message, ##__VA_ARGS__)
#define LOGS_WARN(logerName, message, ...) Tool::ILogger::GetLogsInstance()->Write(__FILE__, __LINE__, Tool::LogLevel::Warning, logerName, message, ##__VA_ARGS__)
#define LOGS_ERROR(logerName, message, ...) Tool::ILogger::GetLogsInstance()->Write(__FILE__, __LINE__, Tool::LogLevel::Error, logerName, message, ##__VA_ARGS__)

}
#endif // ILOGGER_H
